<template>
  <v-layout class="release-container" justify-start align-start wrap>
    <v-flex md12 text-xs-left>
      <v-btn flat round @click="$router.go(-1)">
        <ui-icon icon="angle-left fa-lg"></ui-icon>
        <div class="ml-2">返回</div>
      </v-btn>
    </v-flex>
    <v-flex md6  pt-4>
      <v-layout justify-start align-center wrap px-5>
        <v-flex md12 d-flex align-center justify-start>
          <!-- 充值金额 -->
          <v-flex md4>
            <span class="subTitle title-color">注册账号</span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{ user.loginAccount }}</span>
          </v-flex>
        </v-flex>
        <v-flex md12 d-flex align-center justify-start mt-3>
          <v-flex md4>
            <span class="subTitle title-color">用户名 </span>
          </v-flex>

          <v-flex md2>
            <span class="title title-color">{{user.nickName}}</span>
          </v-flex>
        </v-flex>

        <v-flex md12 d-flex align-center justify-space-between>
          <!-- 充值方式 -->
          <v-flex md4>
            <span class="subTitle title-color">性别</span>
          </v-flex>

          <v-flex md8>
            <v-radio-group v-model="user.gender">
              <v-radio
                v-for="(item, i) in genderTypes"
                :key="i"
                :label="item.text"
                :value="item.value"
                color="primary"
              ></v-radio>
            </v-radio-group>
          </v-flex>
        </v-flex>


        <v-flex md12 mt-2 d-flex align-center justify-space-between>
          <v-flex md4>
            <span class="subTitle title-color">会员备注</span>
          </v-flex>

          <v-flex md8>
            <v-text-field hide-details type="text" solo v-model="user.remark"></v-text-field>
          </v-flex>
        </v-flex>
        

        <v-flex md12 mt-2 d-flex align-center justify-space-between>
          <v-flex md4>
            <span class="subTitle title-color">登录密码</span>
          </v-flex>

          <v-flex md8>
            <v-text-field hide-details type="password" solo v-model="user.password"></v-text-field>
          </v-flex>
        </v-flex>
        
        <v-flex md12 mt-2 d-flex align-center justify-space-between>
          <v-flex md4>
            <span class="subTitle title-color">验证登录密码</span>
          </v-flex>

          <v-flex md8>
            <v-text-field hide-details type="password" solo v-model="user.confirmedPassword"></v-text-field>
          </v-flex>
        </v-flex>
        
        <v-flex md12 mt-3 d-flex align-center justify-space-between>
          <!-- 充值方式 -->
          <v-flex md4>
            <span class="subTitle title-color">是否为管理员</span>
          </v-flex>

          <v-flex md8>
            <v-select solo :items="adminStatus" v-model="user.state">

            </v-select>
          </v-flex>
        </v-flex>


        <v-flex md12 mt-4 d-flex align-center justify-center>
          <v-flex md4>
            <v-btn large round color="primary" @click="onSave">
              <span class="title">保存</span>
            </v-btn>
          </v-flex>
        </v-flex>
      </v-layout>
    </v-flex>
  </v-layout>
</template>


<script lang="ts">
// 使用类装饰器
import { Component, Vue } from "vue-property-decorator";
import { KV } from "@/utils/type";
import { Todo } from '@/api';
declare const $Vue: Vue;

@Component({})
export default class TopupAudit extends Vue {
  private genderTypes: Array<KV> = [
    {
      text: "男",
      value: 1
    },
    {
      text: "女",
      value: 2
    }
  ];

  private adminStatus: Array<KV> = [
    {
      text: "是",
      value: 1
    },
    {
      text: "否",
      value: 2
    },
  ];

  private user: any = {
  };

  protected mounted() {
    let user: any = sessionStorage.getItem('UserSetting');
    this.user = JSON.parse(user);
  }

  private onSave() {

  }

  private async saveUserInfo() {
    // const params = {};
    // const { data } = await Todo.buyerAudit.r(params);
    // console.log('buyerAudit', data);
    // if (data.result === 0) {

    // } else {
    //   $Vue.$emit('snackbar', {
    //     message: data.message
    //   });
    // }
    
  }
}
</script>

<style lang="less" scoped>

</style>


